package net.mysoft.budgetsoft.system.pagemodel;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import net.mysoft.framework.cache.Cache;
import net.mysoft.framework.cache.CacheManager;

/**
 * 
 * @author dagongPGP v1.0
 * @link <a href=http://www.dagongsoft.net>北京大公信软科技有限公司</a>
 * 
 * @version $Revision: 1.00 $Date: 2014-01-11 18:03:54
 */

public class XiTongXX implements java.io.Serializable {

	private String ids;
	private int page;// 当前页
	private int rows;// 每页显示记录数
	private String sort;// 排序字段名
	private String order;// 按什么排序(asc,desc)

	private String bianHao;
	private String fromId;
	private String neiRongCJ; // 内容纯净版
	private String toId;
	private java.util.Date shiJian;
	private String shiJianXS;
	private String neiRong;
	private Integer zhuangTai;
	private String zhuangTaiXS;
	private String fromYongHuM;
	private String toYongHuM;
	private Date datetimeStart;
	private Date datetimeEnd;
	private Integer cuiBanLX;
	private Integer shiFouTC;

	public String getIds() {
		return ids;
	}

	public void setIds(String ids) {
		this.ids = ids;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getOrder() {
		return order;
	}

	public void setOrder(String order) {
		this.order = order;
	}

	public String getBianHao() {
		return this.bianHao;
	}

	public void setBianHao(String bianHao) {
		this.bianHao = bianHao;
	}

	public String getFromId() {
		return this.fromId;
	}

	public void setFromId(String fromId) {
		this.fromId = fromId;
	}

	public String getToId() {
		return this.toId;
	}

	public void setToId(String toId) {
		this.toId = toId;
	}

	public java.util.Date getShiJian() {
		return this.shiJian;
	}

	public void setShiJian(java.util.Date shiJian) {
		this.shiJian = shiJian;
	}

	public String getNeiRong() {
		return this.neiRong;
	}

	public void setNeiRong(String neiRong) {
		this.neiRong = neiRong;
	}

	public Integer getZhuangTai() {
		return this.zhuangTai;
	}

	public void setZhuangTai(Integer zhuangTai) {
		this.zhuangTai = zhuangTai;
	}

	public Integer getCuiBanLX() {
		return this.cuiBanLX;
	}

	public void setCuiBanLX(Integer cuiBanLX) {
		this.cuiBanLX = cuiBanLX;
	}

	public Integer getShiFouTC() {
		return this.shiFouTC;
	}

	public void setShiFouTC(Integer shiFouTC) {
		this.shiFouTC = shiFouTC;
	}

	public String getNeiRongCJ() {
		if (this.getNeiRong() == null) {
			return null;
		} else {
			if (this.getNeiRong().indexOf("<a") >= 0) {
				// 把链接剔除掉
				neiRongCJ = this.getNeiRong().substring(this.getNeiRong().indexOf(">") + 1, this.getNeiRong().lastIndexOf("<"));
				return neiRongCJ;
			}
			return this.getNeiRong();
		}
	}

	public void setNeiRongCJ(String neiRongCJ) {
		this.neiRongCJ = neiRongCJ;
	}

	public String getZhuangTaiXS() {
		if (this.zhuangTai == null) {
			return null;
		} else {
			Object o2 = CacheManager.getContent("XiTongXXZT");
			List<DictionaryDetail> xiaoXiZTList = new ArrayList<DictionaryDetail>();
			if (o2 != null) {
				Cache cache = (Cache) o2;
				xiaoXiZTList = (List<DictionaryDetail>) cache.getValue();
			}
			for (DictionaryDetail d : xiaoXiZTList) {
				if (d.getDetailID().equals(this.zhuangTai + "")) {
					return d.getDetailName();
				}
			}
		}
		return null;
	}

	public String getFromYongHuM() {
		return fromYongHuM;
	}

	public void setFromYongHuM(String fromYongHuM) {
		this.fromYongHuM = fromYongHuM;
	}

	public String getToYongHuM() {
		return toYongHuM;
	}

	public void setToYongHuM(String toYongHuM) {
		this.toYongHuM = toYongHuM;
	}

	public String getShiJianXS() {
		String shijianXS = null;
		if (this.shiJian != null) {
			shijianXS = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(this.shiJian);
		}
		return shijianXS;
	}

	public void setShiJianXS(String shiJianXS) {
		this.shiJianXS = shiJianXS;
	}

	public Date getDatetimeStart() {
		return datetimeStart;
	}

	public void setDatetimeStart(Date datetimeStart) {
		this.datetimeStart = datetimeStart;
	}

	public Date getDatetimeEnd() {
		return datetimeEnd;
	}

	public void setDatetimeEnd(Date datetimeEnd) {
		this.datetimeEnd = datetimeEnd;
	}

	@Override
	public int hashCode() {
		if (this.getBianHao() == null)
			return super.hashCode();
		int prime = 0;
		prime += this.getBianHao().hashCode();
		return prime;
	}

	@Override
	public boolean equals(Object obj) {
		boolean isEquals = false;
		if (obj != null && this.getClass() == obj.getClass()) {
			XiTongXX clazz = (XiTongXX) obj;
			if (clazz.getBianHao().equals(this.getBianHao()))
				isEquals = true;
			return isEquals;
		}
		return isEquals;
	}

}